package com.daka.service.qnzyz;

import com.daka.entity.Activity;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @author beliveli
 * Get information from config file
 */

public class ConfigUtil {
    
    public static String clientId ="100009";
    public static String pubKey= "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC0FhAal1diWCkErdynsiCaw9yKuNTs7OQwoP4rYivCNXe2bgATYRrSXNih3V+UzCdIcKZr/YI2zXOdNHwxJmORmqd+vDcDm7PeFlqWHX4tiMAEiHfvJ6r3rXW2oYhNeajvX/TqPmGF/sKsIrmFitbQfzMVjQ8RiCwDIkqRed6seQIDAQAB";
    public static String appRoot="http://test.dakaqi.cn:3030/admin/";

    public static void buildConfig(){
        Properties properties = new Properties();
        InputStream inputStream = null;
        try {
            Activity a = new Activity();
            String path = a.getClass().getResource("/").getFile().toString() + "/bh.properties";
            inputStream = new FileInputStream(path);
            properties.load(inputStream);

            ConfigUtil.clientId = properties.getProperty("prod.clientId");
            ConfigUtil.pubKey = properties.getProperty("prod.clientId.pubKey");

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
